/*
 * ping.h
 *
 * Created: 14.10.2013
 *  Author: qw3r
 */


#ifndef PING_H_
#define PING_H_

/* Hardware pin definitions */

#define PING_TRIG1_PORT		PORTB
#define PING_TRIG1_DDR		DDRB
#define PING_TRIG1_PIN		PB1
#define PING_TRIG1			PING_TRIG1_PORT, PING_TRIG1_PIN

#define PING_TRIG2_PORT		PORTB
#define PING_TRIG2_DDR		DDRB
#define PING_TRIG2_PIN		PB2
#define PING_TRIG2			PING_TRIG2_PORT, PING_TRIG2_PIN

//#define PING_ECHO_PIN		PB0


/* PING FLAG BIT MASK */

#define PING_FID01			0x01
#define PING_FID02			0x02
#define PING_FID03			0x04
#define PING_FID04			0x08
#define PING_FID05			0x10
#define PING_FID06			0x20
#define PING_FECHO			0x40
#define PING_FLOCK			0x80

/* Functions prototypes */

void ping_init( void );
void ping_routine ( uint16_t *dist );

#endif /* PING_H_ */